import os

from markdownify import markdownify as md

for i in os.listdir('./html'):
    with open(f'./html/{i}', 'r', encoding='utf-8')as f:
        s = md(f.read())
        with open(f'./md/{i[:-5]}.md', 'w', encoding='utf-8')as file:
            file.write(s)
